/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package be.ugent.medirem.persistence.facade;

import be.ugent.medirem.persistence.entity.details.GpDetails;
import be.ugent.medirem.persistence.entity.details.LocationDetails;
import be.ugent.medirem.persistence.entity.details.PatientDetails;
import be.ugent.medirem.persistence.entity.values.PatientValues;
import be.ugent.medirem.persistence.exception.EntityNotFoundException;
import java.util.List;
import javax.ejb.Local;

/**
 *
 * @author Thomas Roelens
 */
@Local
public interface PatientDaoLocal {

    /***************
     * Patient things
     ***************/
    /**
     * A Patient is added given username, password and social security nr
     * @param username
     * @param password
     * @param socialsecuritynr
     */
    Long create(String username, String password, String socialsecuritynr);

    Long create (PatientValues values);

    PatientDetails getDetails(Long patientId) throws EntityNotFoundException, IllegalArgumentException;

    LocationDetails getLocationDetails(Long patientId) throws EntityNotFoundException, IllegalArgumentException;

    List<PatientDetails> getAllPatients();

    void remove(Long patientId) throws EntityNotFoundException, IllegalArgumentException;

    void update(PatientValues details) throws EntityNotFoundException, IllegalArgumentException;

    void update(Long patientId, Long locationId) throws EntityNotFoundException, IllegalArgumentException;

    void updatePassword(Long id, String oldPassword, String newPassword) throws EntityNotFoundException, IllegalArgumentException;

    public Long getPatientId(String username) throws IllegalArgumentException;

    /***************
     * GP things
     ***************/
    // Todo: only data that is public should be shown
    List<GpDetails> getGpPublicDetails(Long patientId);

    PatientDetails searchPatientsBySocialSecurityNumber(String number);
}
